package com.zhaowenhao.hello.demo.controller;

import com.zhaowenhao.hello.demo.service.IDemoService;
import com.zhaowenhao.hello.spring.framework.annotation.WHAutowired;
import com.zhaowenhao.hello.spring.framework.annotation.WHController;
import com.zhaowenhao.hello.spring.framework.annotation.WHRequestMapping;
import com.zhaowenhao.hello.spring.framework.annotation.WHRequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Description:
 * @Author: zwh
 * @Date: 2020-07-24
 * @Time: 16:53
 */
@WHController
@WHRequestMapping("/demo")
public class DemoController {
    @WHAutowired
    private IDemoService demoService;

    @WHRequestMapping("/query")
    public void get(HttpServletRequest req, HttpServletResponse res
            , @WHRequestParam("name") String name, @WHRequestParam("id") String id) throws IOException {
        String hello = demoService.get(name, id);
        res.getWriter().println(hello);
    }
}
